package com.weiyi.portal.modules.ums.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.weiyi.portal.modules.ums.model.UmsChatMessage;
import com.weiyi.portal.dto.ChatListDTO;
import com.weiyi.portal.dto.ChatMessageDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author PZC
 * @since 2022-10-30
 */
public interface UmsChatMessageMapper extends BaseMapper<UmsChatMessage> {
    int selectIsSaveWindows(@Param("linkId") String linkId, @Param("fromUser") String fromUser, @Param("toUser") String toUser);
    List<ChatListDTO> selectChatLists(String fromUser);
    List<ChatMessageDTO> selectChatMessages(@Param("linkId") String linkId, @Param("startIndex") int startIndex, @Param("messageSize") int messageSize);
    void updateIsSaveWindows(@Param("linkId") String linkId, @Param("fromUser") String fromUser);
    void updateOtherWindows(@Param("linkId") String linkId, @Param("fromUser") String fromUser);
    void updateUnread(@Param("fromUser") String fromUser, @Param("toUser") String toUser, @Param("newUnread") int newUnread, @Param("linkId") String linkId);
    int selectUnreadTotalNumber(String username);
    void clearUnread(@Param("fromUser") String fromUser, @Param("toUser") String toUser, @Param("linkId") String linkId);
    void resetWindows(String username);

}
